Skip to content

Comments

Add YUYV support, improved Latency#5

Merged
codujin merged 8 commits intomainfrom
dev
Jan 27, 2026
Merged

Add YUYV support, improved Latency#5
codujin merged 8 commits intomainfrom
dev

Conversation

@codujin
Copy link
Owner

@codujin codujin commented Jan 27, 2026

This pull request introduces major enhancements to the application's video capture capabilities, most notably adding support for the YUYV video format alongside MJPEG, and improving configuration, build, and release processes. The changes enable runtime switching between MJPEG and YUYV formats, optimize performance for YUYV decoding, and provide more robust versioning and artifact management. Documentation has also been updated to reflect these new features and improvements.

Video Format Support and Decoding Enhancements:

  • Added support for the YUYV video format with a new YuyvDecoder class, enabling runtime switching between MJPEG and YUYV formats. The decoder is optimized for 60fps at 1080p using compiler auto-vectorization. The application UI now allows users to select the video format and filters available resolutions accordingly (src/core/Application.cpp, src/video/YuyvDecoder.cpp, src/video/YuyvDecoder.h, CMakeLists.txt, README.md, src/README.md). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]

  • Improved configuration persistence to save and restore the selected video format, resolution, framerate, and other settings (src/README.md, README.md). [1] [2]

Build and Performance Improvements:

  • Changed the default build type to Release and added optimization flags (-O3 -march=native) for both debug and release builds to maximize performance, especially for YUYV decoding (CMakeLists.txt, .github/workflows/build.yml, README.md). [1] [2] [3]

  • Updated the versioning system to read from a VERSION file and auto-generate version info for semantic versioning (CMakeLists.txt, VERSION, README.md, src/README.md). [1] [2] [3] [4]

Release and Artifact Management:

  • Enhanced GitHub Actions workflows to prepare and upload dev build artifacts only on the dev branch, and improved prerelease detection for releases (.github/workflows/build.yml, .github/workflows/release.yml). [1] [2] [3]

Documentation Updates:

  • Updated README.md and src/README.md to document dual format support, configuration changes, utilities, performance notes, and new decoder classes. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Source Structure and Utilities:

  • Added new test utility YuyvDecodeTest and updated project structure to include YUYV decoder sources and tests (CMakeLists.txt, README.md, src/README.md). [1] [2] [3] [4] [5] [6]

These changes collectively modernize the application, improve video format flexibility, and streamline the build and release process for both developers and users.

- Automatic version generation from VERSION file via CMake
- Version.h now auto-generated at configure time
- Framerate dropdown in UI instead of long menu list
- Fixed framerate not being set in V4L2 capture (VIDIOC_S_PARM)
- Add Version.h to .gitignore as generated file
- Implement YuyvDecoder module with ITU-R BT.601 color space conversion
- Add video format selection UI (MJPEG/YUYV dropdown)
- Extend VideoCapture to support both MJPEG and YUYV formats via V4L2
- Add videoFormat to Config system for persistence across sessions
- Create YuyvDecodeTest validation program
- Optimize YUYV decoder with pointer arithmetic and value reuse
- Configure Release build with -O3 and -march=native flags for 60fps performance
- Update CMake to default to Release mode when BUILD_TYPE not specified

This implementation achieves 60fps at 1080p for both formats on modern CPUs
through efficient CPU-based conversion and compiler auto-vectorization.
Changed prerelease detection from explicit list (-alpha, -beta, etc.)
to any version containing a hyphen (e.g., 1.2.0-yuyv.1, 1.3.0-test.5).

This allows flexible experimental release tagging while keeping stable
releases clean (1.1.0, 1.2.0, etc.).
- Changed build type from Debug to Release for performance testing
- Upload compiled binary as artifact when pushing to dev branch
- Artifacts retained for 30 days for testing and distribution
- Still validates builds on main branch without artifact upload
- Document YUYV format support and performance characteristics
- Update feature list with dual format support and optimizations
- Add performance section comparing MJPEG vs YUYV
- Document YuyvDecoder module and YuyvDecodeTest utility
- Update build instructions to recommend Release mode
- Add releases section explaining stable vs experimental builds
- Mention semantic versioning and auto-generated version info
- Update src/README.md with YuyvDecoder architecture details
- Add pixelFormat field to VideoFormat struct to track format type
- Refactor QueryFormats() to enumerate all pixel formats (MJPEG, YUYV, etc.)
  instead of hardcoding MJPEG only
- Filter resolution/framerate options in UI based on selected video format
- Auto-select first available resolution when switching formats
- Remove obsolete TODO comment about extending to other formats
@codujin codujin merged commit 29538a1 into main Jan 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant